Professor:
Members (student number):
Date:
#importing all required packages
import pandas as pd
import csv
import numpy as np
import math
import scipy
import matplotlib.pyplot as plt
import seaborn as sns
import plotly.express as px
import plotly.graph_objects as go
from plotly.subplots import make_subplots
import plotly.graph_objects as go
# Datasets
# The main dataset about flights movements of all Dutch Airports. source: cbs.nl
file_path = 'https://raw.githubusercontent.com/DavidVlot/TIL6010-LabAssignments/main/Final%20Assignment/basisdata.csv'
da = pd.read_csv(file_path, delimiter=";")
# Dataset 1 (used data derived from this dataset starts with the letter d)
# The original data set had airport codes instead of airport names. The codes are replaced with airports names.
da['Airports'] = da['Airports'].replace('A045844', 'Total Dutch')
da['Airports'] = da['Airports'].replace('A043590', 'AMS Schiphol')
da['Airports'] = da['Airports'].replace('A043596', 'Rotterdam The Hague')
da['Airports'] = da['Airports'].replace('A043591', 'Eindhoven')
da['Airports'] = da['Airports'].replace('A043595', 'Maastricht Aachen')
da['Airports'] = da['Airports'].replace('A043593', 'Groningen Eelde')
da.to_csv('https://raw.githubusercontent.com/DavidVlot/TIL6010-LabAssignments/main/Final%20Assignment/changedata.csv')
# Dataset 2 (used data derived from this dataset starts with the letter f)
# For the maximum number of flights movements per airport in the Netherlands the following dataset is used:
flydata = 'https://raw.githubusercontent.com/DavidVlot/TIL6010-LabAssignments/main/Final%20Assignment/flydata.csv'
fa = pd.read_csv(flydata, delimiter=";")
# For furthur visualisations a couple of filters will be used. To make this a easier proces a Function is omplemented.
def filter_data(y, a):
filter = da['Periods'].str.contains(y, case=False, na=True)
filter
st = da[filter]
filter2 = st['Airports'].isin([a])
filter2
db = st[filter2]
return db
# filter data frame on years and AMS Schiphol
dc = filter_data('JJ','AMS Schiphol')
# filter data frame on last ten years (columns)
dd = dc.tail(10)
# filter data fram on years and EIN
de = filter_data('JJ','Eindhoven')
# filter data frame on last ten years (columns)
df = de.tail(10)
# input needed for x-axis
years = ['2012','2013','2014','2015','2016','2017','2018','2019','2020','2021']
# pie chart (subquestion 2)
# filtering on only years in the dataset
dg = da['Periods'].str.contains('JJ', case=False, na=True)
dh = da[dg]
# filtering out the Total Dutch Airports
di = dh['Airports'].isin(['Groningen Eelde','AMS Schiphol','Eindhoven','Maastricht Aachen','Rotterdam The Hague'])
dj = dh[di]
# filtering on four different years
dk = dj['Periods'].isin(['2015JJ00'] + ['2017JJ00'] + ['2019JJ00'] + ['2021JJ00'])
dl = dj[dk]
# bar chart (subquestion 2)
# filter dj filters out Total Dutch values.
dm = dh[di].sort_values(by=['Periods'])
# pie chart (subquestion 3)
# filtering on Amsterdam Airport
dn = dh['Airports'].isin(['AMS Schiphol','Eindhoven'])
dn = dh[dn]
# filtering on two different years
do = dn['Periods'].isin(['2015JJ00'] + ['2019JJ00'])
do = dn[do]
do.head()
# Libaries for pie charts (subquestion 3)
dp = {'Europe':40682961,
'Africa':2598267,
'America':8736767,
'Asia':6227296,
}
dq = {'Europe':50554748,
'Africa':2872100,
'America':11005689,
'Asia':7247192,
}
dr = {'Europe':4259828,
'Africa':113819,
'America':235,
}
ds = {'Europe':6428117,
'Africa':296182,
'Asia':56476
}
The Dutch aviation sector has developed enourmously the last decade. As flight tickets became more affordable, the demand for traveling with an aircraft increased the last ten years. However, the Dutch government has set a maximum flight capacity for two airports in the Netherlands: Amsterdam Airport Schiphol and Eindhoven airport. The maximum flight capacity has set in place in order to restrict and discourage noise and pollution (external effects).
But what are the operational effects on the air traffic at the dutch airport? This question shall be divided in subquestions and shall be answered with visualisations with the aim to gain insights in the effects.

In this report the research question will be considered with the help of data visualises gained by the dataset mentioned above.
Research Question: How did the maximum amount flight per Dutch Airport set by the government influences the air traffic at each airport over the last ten years?
Research Subquestions:
The obligated maximum flight capacity is only applicable for Amsterdam Airport Schiphol and Eindhoven Airport. In order to seek for which years the flight movements reached the maximum capacity, a bar chart (for total flight movements per year in the last decade) has been made which is combined with a line graph which visualises the obligated maximum flight capacity.
For Amsterdam Airport Schiphol the total flight movements grew every year between the years 2012-2016. In 2017 the flight movements almost reached the maximum flight capacity. In 2018 and 2019 the total flight movements have reached the maximum flight capacity (both years around 499.000 flight movements). When there wasn't a maxmimum flight capacity the total flight movements would have grown above the 500.000 flight movements a year. The flight movements in 2020 and 2021 are not representive for this research question as the decreasing flight movements are caused by external factors (COVID-19).
To conclude, the graph shows that only for 2018 and 2019 the maximum flight capacity has been reached focussing on Amsterdam Airport Schiphol.
fig = plt.figure(figsize=(12, 9)) #create figure for plotting
gs = fig.add_gridspec(nrows=2, ncols=2) #specify grid number of rows and columns in figure
ax1 = dd.plot(x='Periods', y='TotalFlights_3', figsize=(10, 5), kind='bar', label='Amount of flights AMS')
ax2 = fa['AMS'].plot(secondary_y=False, color='orange', label='Maximum flights AMS')
ax1.set_title('Total flights for AMS Schiphol airport 2012-2021')
ax1.set_ylabel('Total Flights')
ax1.set_xticklabels(years, minor=False, rotation=45)
ax1.set_ylim(0, 600000)
ax1.legend()
ax2.set_ylabel('Amount of flights')
ax2.set_ylim(0,650000)
ax2.legend()
<matplotlib.legend.Legend at 0x7f927a6aef90>
<Figure size 1200x900 with 0 Axes>
For the maximum flight capacity at Eindhoven airport, the same graph setting as for Amsterdam Airport Schiphol are used. At Eindhoven airport the governement started with a maximum flight capacity in 2017 as can be seen in the graph below. In the years before (2012 - 2016) the flight movements at Eindhoven airport grew steadily each year. Another observation which can be done is that the Dutch government decreased the maximum flight capacity in 2019. The flight movement came close to the maximum flight capacity, but had still some space to grow till it reached the maximum flight capacity. Thereafter, in the years 2020 and 2021, the flight movements dropped caused by COVID 19. If COVID-19 had not occured, the assumption is made that the flight movements would have reached the maximum capacity based on the steadily growth of previous years.
At last, it is clear from the graph that for Eindhoven airport the maximum flight capacity has not been reached for any year in the last decade.
fig = plt.figure(figsize=(12, 9)) #create figure for plotting
gs = fig.add_gridspec(nrows=2, ncols=2) #specify grid number of rows and columns in figure
ax1 = df.plot(x='Periods', y='TotalFlights_3', figsize=(10, 5), kind='bar', label='Amount of flights EIN')
ax2 = fa['EIN'].plot(secondary_y=False, color='orange', label='Maximum flights EIN')
ax1.set_title('Total flights for Eindhoven airport 2012-2021')
ax1.set_ylabel('Total Flights')
ax1.set_xticklabels(years, minor=False, rotation=45)
ax1.set_ylim(0, 600000)
ax1.legend()
ax2.set_ylabel('Amount of flights')
ax2.set_ylim(0,50000)
ax2.legend()
<matplotlib.legend.Legend at 0x7f927adbec90>
<Figure size 1200x900 with 0 Axes>
The aviation sector has developed enormously the last decade. Before effects can be determined it is crucial to indicate the flight movements during the last decade for each Dutch airport. From the result the increase or decrease ratio can be determined in order to seek which airport grew the most.
A pie chart visualisation is choosen to answer this first subquestion. Four pie charts are shown at four different periods (i.e 2015, 2017, 2019, 2021).
The biggest part of the flights from and to The Netherlands can be found at Schiphol Airport, with around 87.5 to 90 percent. The other four Dutch airports take the remaining 10 to 12.5 percent. Big proportions of this remaining percentage is occupied by Eindhoven Airport as the second most used airport and Rotterdam The Hague airport as the third most used airport in The Netherlands.
In summary, from these pie charts there is no significant shift in ratio between total flights over the different Airports in the Netherlands when comparing the four different years. Based upon these pie charts, it is therefore hard to distinguish an influence of the maximum flight capacity for these differences between the years.
figa = px.pie(dl, values='TotalFlights_3', names='Airports', title='Ratio between the different aiports in The Netherlands', color='Airports',
color_discrete_map={'AMS Schiphol':'lightcyan',
'Rotterdam The Hague':'red',
'Eindhoven':'green',
'Maastricht Aachen':'pink',
'Groningen Eelde': 'orange'},facet_col="Periods")
figa.show()
When looking at the last 25 years, Schiphol remained the most used Dutch airport. When the flight capacity of 500k flights was reached, the airport stopped with the increase of the amount of flights. Groningen Eelde airport continued to be the least used Dutch airport during the last 25 years. The other three Dutch airports all switched positions during the last 25 years. The amount of flights from and to Eindhoven Airport increased overtime, while these numbers for Rotterdam The Hague airport decreased overtime.
An explanation for the decreased amount of flights from and to Rotterdam The Hague Airport could be that the function of this airport became less relevant due to the fast expanding of the neighbouring Schiphol Airport. Eindhoven Airport developed itself to become an important airport for the southern part of The Netherlands, where travelling distances from and to Schiphol were higher. Groningen Eelde airport and Maastricht Aachen airport probably continued to have a small amount of flights, possibly because these airports lie within lesser populated areas in The Netherlands compared to the other three Dutch airports.
Based upon this figure, it can be concluded that the maximum flight capacity of Schiphol created the oppurtinity for other airports further away from Schiphol to gain popularity. This can most certainly be seen for Eindhoven Airport, which took over the position of Rotterdam The Hague airport as the second most used airport.
figb = px.bar(dj, x='TotalFlights_3', y='Airports', color='Airports', animation_frame='Periods',
animation_group = 'Airports', height = 1000, orientation='h', text_auto=True)
figb.update_traces(textfont_size=12, textangle=0, textposition='outside',
cliponaxis=False)
figb.update_layout(yaxis={'categoryorder': 'total ascending'})
figb.show()
Another interesting question is to check whether the maximum amount of flights has influence on the flight destinations from the Dutch Airports. As stated before, the maximum amount of flights at AMS Schiphol is reached in 2017, 2018 and 2019. Therefore, in the pie chart below the flight destinations before and during this period is taken. To get a better overview the destinations are wrapped to continents only, instead of all countries.
As shown in the pie chart, the passenger destination distribution does not shift significantly between 2015 and 2019 at AMS Schiphol and Eindhoven. At Eindhoven a small growth to Africa and Asia appears, however it can not be stated the maximum amount of flights reached at AMS Schiphol has direct impact on this small growth. Considering the airports Groningen Eelde, Maastricht Aachen and Rotterdam The Hague, there was a negligible amount of flights that goes outside Europe to take into account.
In summary, it seems that the maximum amounts of flights for AMS Schiphol does not influence the flight destinations of the Dutch Airports. Small changes of destination distribution appear over time, although this can not directly be linked to the reached maximum amount of flights at AMS Schiphol.
#lay out of pie charts
textprops = {"fontsize":7}
explode = [0,0.4,0]
#pie chart 1: Passenger destination distribution from AMS Schiphol in 2015
plt.subplot(2, 2, 1)
plt.pie(dp.values(), labels=dp.keys(), autopct='%1.0f%%', textprops = textprops, radius = 1.2)
#plt.axis('equal')
plt.title('Passenger destination distribution from Schiphol in 2015 ')
plt.show()
#pie chart 2: Passenger destination distribution from AMS Schiphol in 2019
# Plot
plt.subplot(2, 2, 2)
plt.pie(dq.values(), labels=dq.keys(), autopct='%1.0f%%', textprops = textprops, radius = 1.2)
#plt.axis('equal')
plt.title('Passenger destination distribution from Schiphol in 2019 ')
plt.show()
#pie chart 3: Passenger destination distribution from Eindhoven in 2015
# Plot
plt.subplot(2, 2, 3)
plt.pie(dr.values(), labels=dr.keys(), autopct='%1.0f%%', textprops = textprops, explode = explode, radius = 1.2)
#plt.axis('equal')
plt.title('Passenger destination distribution from Eindhoven in 2015 ')
plt.show()
#pie chart 4: Passenger destination distribution from Eindhoven in 2019
# Plot
plt.subplot(2, 2, 4)
plt.pie(ds.values(), labels=ds.keys(), autopct='%1.0f%%', textprops = textprops, explode = explode, radius = 1.2)
#plt.axis('equal')
plt.title('Passenger destination distribution from Eindhoven in 2019 ')
plt.show()
An important aspect of the airports is the total number of passengers. The two figures below show the development of the total passengers at the airports: AMS Schiphol and Eindhoven.
As shown in the previous subquestions AMS Schiphol reached its maximum flight capacity in 2018. This would indicate that the total number of passengers would also reach its maximum in 2018. The figure below shows that there indeed is a slower increase in total passengers from 2018 but there is still an increase. This concludes that with the same amount of flights more passengers flying from AMS Schiphol. This will be explained below.
Eindhoven did not reach its maximum flight capacity and the total number of passengers increase following a relatively continuous trend.
fig = px.line(dd, x = 'Periods', y = 'TotalPassengers_12', title = ' Total passengers from Amsterdam Schiphol Airport')
fig.show()
fig = px.line(df, x = 'Periods', y = 'TotalPassengers_12', title = ' Total passengers from Eindhoven Airport')
fig.show()
The fact that the total number of passengers increases while the total number of flights stays the same has to do with the fact that there are more passengers per plane. The figure below shows the total amount of flights together with the number of passengers per flight for AMS Schiphol. The number of passengers per flight has increased over the years. This explains why the total number of passengers still increases at AMS Schiphol.
The reason for this increase can’t be found in the data. Bigger airplanes are a possibility but also a higher occupancy rate can be the reason.
Eindhoven has a increase in passengers per flight following a relatively continuous trend.
In summary, the maximum flight capacity leads to a slower increase in the total number of passengers at AMS Schiphol. The remaining increase can be explained by the fact that there is an increase in the number of passengers per plane.
Eindhoven did not reach its maximum flight capacity and the total number of passengers increase following a relatively continuous trend.
# Create figure with secondary y-axis
fig = make_subplots(specs=[[{"secondary_y": True}]])
# Add traces
fig.add_trace(
go.Scatter(x=dd['Periods'], y=dd['TotalFlights_3'], name="Total flights"),
secondary_y=False,
)
fig.add_trace(
go.Bar(x=dd['Periods'], y=dd['Passengers_flight'], name="Passengers per flight", marker={"opacity": 0.4}),
secondary_y=True,
)
# Add figure title
fig.update_layout(
title_text="Total flights and passengers per flight for Amsterdam Schiphol Airport"
)
# Set x-axis title
fig.update_xaxes(title_text="Periods")
# Set y-axes titles
fig.update_yaxes(title_text="<b>Total flights</b> ", secondary_y=False)
fig.update_yaxes(title_text="<b>Passengers per flight</b>", secondary_y=True)
fig.show()
# Create figure with secondary y-axis
fig = make_subplots(specs=[[{"secondary_y": True}]])
# Add traces
fig.add_trace(
go.Scatter(x=df['Periods'], y=df['TotalFlights_3'], name="Total flights"),
secondary_y=False,
)
fig.add_trace(
go.Bar(x=df['Periods'], y=df['Passengers_flight'], name="Passengers per flight", marker={"opacity": 0.4}),
secondary_y=True,
)
# Add figure title
fig.update_layout(
title_text="Total flights and passengers per flight for Eindhoven"
)
# Set x-axis title
fig.update_xaxes(title_text="Periods")
# Set y-axes titles
fig.update_yaxes(title_text="<b>Total flights</b> ", secondary_y=False)
fig.update_yaxes(title_text="<b>Passengers per flight</b>", secondary_y=True)
fig.show()
The research question was: How did the maximum amount flight per Dutch Airport set by the government influences the air traffic at each airport over the last ten years?
It is hard to compile the effects or influences in one graph, which represents the final conclusion. Instead, a summary of all conclusion will be made about every sub question which fungates as the final conclusion of this research.
At start, the years where the flight movements has reached the maximum flight capacity (max. flight cap.) has been investigated. At Amsterdam airport Schiphol, in 2018 and 2019 the maximum flight capacity has been reached with a total amount of flights of around 496.000 - 499.000 flights for each year (2018 and 2019). For Eindhoven Airport flight movements have not reached the maximum flight capacity in the last decade.
At second, pie charts were made in order to investigate any shifts in flight movements between airports in the last decade. It can be concluded that there are not any shifts recognised in flight movements between Dutch airports caused by the maximum flight capacity. In the year 2019 where the maximum flight capacity has reached, the ratio did not significantly change from 2017.
Moreover, a bar chart has been made in order to seek how the total flight movements at all Dutch airports developed in the last 25 years. It came clear that regional airports, especially Eindhoven airport grew enormously. However a relation with the maximum flight capacity cannot be made as in it is unclear if the increase in growth at regional airports came from the max. flight cap. at AMS or just a higher demand for flying from a regional airport.
At third, shifts in flight destinations are investigated by comparing flight destinations (flights fly to different continents). It seems that the maximum amounts of flights for AMS Schiphol does not influence the flight destinations of the Dutch Airports. Small changes of destination distribution appear over time, although this cannot directly be linked to the reached maximum amount of flights at AMS Schiphol.
At last, the passenger fluctuations for the last 10 years are investigated. The ratio of passengers per flight is determined in order to seek if significant changes can be identified. For Amsterdam Airport Schiphol the ratio passenger per flight increased every year from 2012 to 2019. This means that either the utilization of the aircraft increased (fuller airlines) or the airlines choose to fly with bigger planes. Focussing on 2018 and 2019 (when max. flight cap. was reached), the amount of flights were around the same, but the passenger per flight increased from 142 to 144. This means that in the years when the max. flight cap. has reached, the operating airlines became more efficient in their operations (bigger aircraft or better utilization) as the amount of passenger still grew but the amount of flights movements were around the same.
For Eindhoven airport, the passenger per flight grew as well for each year (before 2020: COVID-19). However, at Eindhoven Airport the max. flight cap. has not been reached, which means that is impossible to identify caused by the max. flight cap.
In conclusion, the maximum flight capacity has been reached in 2018 and 2019 at Amsterdam Schiphol Airport and has led to more efficient operations (better utilization or bigger airplanes). As the max. flight cap. has been reached only for two years, only short-term effects could be identified. It is expected that shifts in ratio’s between airports and shifts in flight destinations would occur on the long-term. Therefore, it is advised to execute this research in 5 and 10 years again. Then, it is expected the max. flight cap. has been reached in more years and perhaps the effects in ratio between airports and destinations could be identified as well.
Sten Heijink (5401895) Sten created the figures and provided corresponding conclusions for the following subquestion: 'What are the effects of in- or decreased maximum amount of flights on the number of passengers?' Furtermore, Sten wrote the code together with Bartosz that altered all the needed data for our computations in order to be able to work with this data. Lastly, Sten wrote the function that filters the data and created a internal Excel-document where are the filter-references are stored.
Titus Kraanen (5826853) Titus created the figures and provided corresponding conclusions for the following subquestion: 'To which continents or European destinations do the flights from the Dutch aiports go to?'
Bart Szarszewski (4860802) Bartosz created the figures that gave insight in the obligated maximum flight capacity for each airport. Furtermore, Bartosz wrote the code together with Sten that alterd all the needed data for our computations in order to be able to work with this data.
Michel van Tooren (5654521) Michel created the introduction of the document including corresponding figures. Furthermore, wrote the final conclusions paragraph.
David Vlot (5632145) David created the figures and provided corresponding conclusions for the following subquestion: 'What is the amount of flights operated for each airport?' Furthermore, David collected all the individual figures and corresponding conclusions together. This entire collective was used to form this final document, which was eventually handed in on Brightspace.